package cn.bone.motan.demo1.service;

import cn.bone.motan.demo1.api.Hello;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

/**
 * Created by superbone on 2017/3/9.
 */
@Service
public class HelloServiceImpl implements Hello{

    private Logger logger = LoggerFactory.getLogger("hello");
    @Override
    public String sayHello(String name) {
        return "hello " + name;
    }

    @Override
    public int compute(int a, int b) {

        logger.info("compute()被调用");
        try {
            TimeUnit.MILLISECONDS.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return a + b;
    }
}
